<%@page import="dao.interfaces.IRatingDAO"%>
<%@page import="dao.DAOFactory"%>
<%@page import="dao.DAO"%>
<%@page import="model.Rating" %>
<%@page import="model.User" %>
<%@page import="util.CSSDisplay" %>
<%@page language="java" import="java.util.*" %>
 
<form action="<%=request.getContextPath() %>/ServletController?event=ADD_NOTE&user_id=<%=request.getAttribute("user_id")%>&recipe_id=<%=request.getAttribute("recipe_id")%>&category_id=<%=request.getAttribute("category_id")%>" method="post">
<h3>Ajout d'une note</h3>
	<hr/>
	<label>Note : </label>&nbsp;
	<SELECT NAME="rating">
		<%
			for (int i=1; i<=5 ; i++){
				out.print("<OPTION VALUE=\"" + i + "\">" + i +"</OPTION>");
			}
		%>
	</SELECT> &nbsp;
	<input type="submit" value="Ajouter une note" />
		<div class="addRating">
		<fieldset class="listNumberNotes">
			<%
				IRatingDAO<Rating> ratingDAO = DAOFactory.getRatingDAO();
				List<Rating> ratingList = ratingDAO.getListBy(Integer.parseInt(request.getParameter("id")));
				request.setAttribute("ratingList", ratingList);
			%>
			<jsp:include page="showRating.jsp" flush="true"/>
		</fieldset>
		</div>
</form>

